package com.vvlive.caibao.smartcity.ui;

import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import com.vvlive.caibao.smartcity.base.BaseActivity;
import com.vvlive.caibao.smartcity.view.CommonActionBar;

import org.kymjs.kjframe.ui.BindView;

import smartcity.vvlive.caibao.com.smartc.R;

/**
 * Created by android on 2015/7/4.
 */
public class ForgotPassWord extends BaseActivity implements View.OnClickListener {
    @BindView(id = R.id.c_phone_number)
    private EditText mCphone_number;
    @BindView(id = R.id.change_code)
    private EditText mChange_code;
    @BindView(id = R.id.c_input_pass)
    private EditText mCinput_pass;
    @BindView(id = R.id.c_access_code, click = true)
    private Button mCaccess_code;
    @BindView(id = R.id.change_pass_btn, click = true)
    private Button mChange_passbtn;

    @Override
    protected int getContentViewRes() {
        return R.layout.activity_changepassword;
    }

    @Override
    public void initWidget() {
        super.initWidget();
        CommonActionBar commonActionBar = getCommonActionBar();
        commonActionBar.setTitle(R.string.forgot_password);
        commonActionBar.setMoreVisible(false);
    }

    @Override
    public void onClick(View v) {
        super.onClick(v);
        switch (v.getId()) {
            case R.id.c_access_code:
                break;
            case R.id.change_pass_btn:
                if (Judge()) {
                    alert("注册成功");
                } else {
                    alert("请完善注册信息");
                }
                break;
        }
    }

    private boolean Judge() {
        return !TextUtils.isEmpty(mCphone_number.getText())
                       && !TextUtils.isEmpty(mChange_code.getText().toString())
                       && !TextUtils.isEmpty(mCinput_pass.getText().toString());
    }
}
